<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
<link rel="stylesheet" href="<%=basePath %>/jqwidgets/styles/jqx.base.css"
	type="text/css" />
<link rel="stylesheet" href="<%=basePath %>/jqwidgets/styles/jqx.arctic.css"
	type="text/css" />
<script type="text/javascript" src="<%=basePath %>/scripts/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="<%=basePath %>/layer/layer-1.8.5.min.js"></script>
<script type="text/javascript" src="<%=basePath %>/scripts/myjs.js"></script>
<script type="text/javascript" src="<%=basePath %>/jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="<%=basePath %>/jqwidgets/jqxvalidator.js"></script>
<script type="text/javascript" src="<%=basePath %>/jqwidgets/jqxbuttons.js"></script>
<script type="text/javascript" src="<%=basePath %>/jqwidgets/jqxinput.js"></script>
<script type="text/javascript">
	$(document).ready(
			function() {
				$('#saveButton').jqxButton({
					width : 60,
					height : 25
				});
				$('#saveButton').on('click', function() {
					$('#addsaveForm').jqxValidator('validate');

				});
				$('#addsaveForm').on(
						'validationSuccess',
						function(event) {
							//var sectPage = $("addsaveForm").serializeArray();
							var sectPage = $('#addsaveForm').serializeJson();
							doSaveSubmit('/kss/sectconfig/save.do?savemode=${savemode}',
								sectPage,
								'#refreshbutton');

						});
				// initialize validator.
				$('#addsaveForm').jqxValidator({
					rules : [ {
						input : '#se',
						message : '必填!',
						action : 'keyup, blur',
						rule : 'required'
					}, {
						input : '#ct',
						message : '必填!',
						action : 'keyup, blur',
						rule : 'required'
					}, {
						input : '#strategy',
						message : '必填!',
						action : 'keyup, blur',
						rule : 'required'
					}, {
						input : '#strategy',
						message : '必须大于等于0!',
						action : 'valueChanged',
						rule : function(input, commit) {
							if (input.val() >= 0) {
								return true;
							}
							return false;
						}
					} ]
				});
			});
</script>
<style type="text/css">
.text-input {
	height: 21px;
	width: 150px;
}

.register-table {
	margin-top: 10px;
	margin-bottom: 10px;
}

.register-table td,.register-table tr {
	margin: 0px;
	padding: 2px;
	border-spacing: 0px;
	border-collapse: collapse;
	font-family: Verdana;
	font-size: 12px;
}

h3 {
	display: inline-block;
	margin: 0px;
}
</style>
</head>
<body class='default'>
	<div id="register">
		<div>
			<form id="addsaveForm" action="/kss/sectconfig/save.do?savemode=${savemode}">
				<input type="hidden" id="id" name="id" value="${sectPage.id }"/>
				<table class="register-table">
					<tr>
						<td>*se:</td>
						<td><input type="text" id="se" name="se" 
							value="${sectPage.se }" class="text-input" /></td>
					</tr>
					<tr>
						<td>*ct:</td>
						<td><input type="text" id="ct" name="ct" 
							value="${sectPage.ct }" class="text-input" /></td>
					</tr>
					<tr>
						<td>*strategy:</td>
						<td><input type="text" id="strategy" name="strategy" 
							value="${sectPage.strategy }" class="text-input" /></td>
					</tr>
					<tr>
						<td colspan="6"><input type="button" value="保存"
							id="saveButton" /></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
</html>
